cmake_minimum_required(VERSION 2.8.12)

include_directories(usrtos/include )
link_directories(
    /usr/local/lib
)
IF (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "aarch64")
    add_definitions()
ELSE ()
    add_definitions(-mavx2)
ENDIF (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "aarch64")

find_path(BOOST_ROOT
    NAMES include/boost/chrono.hpp 
    PATHS /usr/include /usr/local/include /usr/local/Cellar/boost/1.73.0
)
# chrono.hpp date_time.hpp filesystem.hpp
message("find Boost ${Boost_DIR}")
set(Boost_USE_MULTITHREADED      ON)
set(Boost_USE_STATIC_RUNTIME    OFF)
find_package(Boost 1.65.0 COMPONENTS date_time filesystem system )
if(Boost_FOUND)
  include_directories(${Boost_INCLUDE_DIRS})
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1z")

add_library(ftcommap SHARED usrtos/usrtoslib.cpp)
target_link_libraries(ftcommap rtlsdr ${Boost_LIBRARIES})

